﻿namespace Net.Server
{
    /// <summary>
    /// kcp服务器
    /// <para>Player:当有客户端连接服务器就会创建一个Player对象出来, Player对象和XXXClient是对等端, 每当有数据处理都会通知Player对象. </para>
    /// <para>Scene:你可以定义自己的场景类型, 比如帧同步场景处理, mmorpg场景什么处理, 可以重写Scene的Update等等方法实现每个场景的更新和处理. </para>
    /// </summary>
    /// <typeparam name="Player"></typeparam>
    /// <typeparam name="Scene"></typeparam>
    public class KcpServer<Player, Scene> : ServerUdpBase<Player, Scene> where Player : KcpPlayer, new() where Scene : SceneBase<Player>, new()
    {
        protected override void AcceptHander(Player client, params object[] args)
        {
            client.Set(Server);
        }
    }

    /// <summary>
    /// 默认kcp服务器，当不需要处理Player对象和Scene对象时可使用
    /// </summary>
    public class KcpServer : KcpServer<KcpPlayer, SceneBase<KcpPlayer>>
    {
    }
}